#coding:utf-8

from flask import Flask
from flask import request
from flask import render_template

app = Flask(__name__)

@app.route('/', methods=['GET', 'POST'])
def home():
	return render_template('‪555.html')

@app.route('/sign', methods=['GET'])
def signin():
	return '''<form action="/sign" method="post">
	          <p><input name="username"></p>
			  <p><input name="password" type="password"></p>
			  <p><button type="submit"/>Sign In</button></p>
	          </form>'''

@app.route('/sign', methods=['POST'])
def deal_sign():
	if request.form['username'] == 'admin' and request.form['password'] == 'password':
		return '<h3>Hello Admin!</h3>'
	else:	
		return '<h3>你无权访问404</h3>'

if __name__ == '__main__':
	app.run(host='localhost', port=5556, debug=True)
	print('程序正在启动中……')